<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on March 12, 2009 at 4:55:38 pm</time-stamp>


<class>
<name>Lot</name>
<environment>SupplyChain</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>number itemList </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.Lot class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.Lot</class-id>
<body>A lot tracks a specific set of items which are all sold at a price point.

Instance Variables:
	itemList	&lt;Collection&gt;	a collection of items
	number	&lt;LargeInteger&gt;	the ID number of this lot

</body>
</comment>

<methods>
<class-id>SupplyChain.Lot</class-id> <category>accessing</category>

<body package="SupplyChain" selector="addItem:">addItem: anItem
	"Adds an item to the list"

	itemList add: anItem.
	^self</body>

<body package="SupplyChain" selector="contains:">contains: anItem
	"Tests if Lot contains an item"

	^itemList contains: [ :i | anItem sku = i sku].</body>

<body package="SupplyChain" selector="itemList">itemList
	^itemList</body>

<body package="SupplyChain" selector="number">number
	^number</body>

<body package="SupplyChain" selector="number:">number: aLargeInteger
	number := aLargeInteger</body>

<body package="SupplyChain" selector="remove:">remove: anItem
	"Removes an item from the Lot"

	^itemList remove: anItem</body>

<body package="SupplyChain" selector="size">size
	"How many items are in this lot?"

	^itemList size</body>
</methods>

<methods>
<class-id>SupplyChain.Lot</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	number := 0.
	itemList := OrderedCollection new.

	^self</body>
</methods>

</st-source>
